<template>
    <el-container>
      <el-header>
        <HeaderComponent />
      </el-header>
      <el-main>
        <section class="py-5">
          <div class="container">
            <div class="my-5">
              <div class="post-meta">
                <span class="post-category">Fashion</span> / <span class="meta-date">Jul 11, 2022</span>
              </div>
              <h1 class="page-title">Feel cool while walking in streets</h1>
            </div>
            <article class="post-item">
              <div class="post-content">
                <div class="post-thumbnail mb-5">
                  <img src="../images/banner-1.jpg" alt="single-post" class="img-fluid">
                </div>
                <div class="post-description py-4">
                  <p>
                    <strong>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Consectetur facilisis vivamus massa magna. Blandit mauris libero condimentum commodo morbi consectetur sociis convallis sit. Magna diam amet justo sed vel dolor et volutpat integer. Iaculis sit sapien hac odio elementum egestas neque. Adipiscing purus euismod orci sem amet, et. Turpis erat ornare nisi laoreet est euismod.</strong>
                  </p>
                  <br>
                  <p>Sit suscipit tortor turpis sed fringilla lectus facilisis amet. Ipsum, amet dolor curabitur non aliquet orci urna volutpat. Id aliquam neque, ut vivamus sit imperdiet enim, lacus, vel. Morbi arcu amet, nulla fermentum vitae mattis arcu mi convallis. Urna in sollicitudin in vestibulum erat. Turpis faucibus augue ipsum, at aliquam. Cras sagittis tellus nunc integer vitae neque bibendum eget. Tempus malesuada et pellentesque maecenas. Sociis porttitor elit tincidunt tellus sit ornare. Purus ut quis sed venenatis eget ut ipsum, enim lacus. Praesent imperdiet vitae eu, eu tincidunt nunc integer sit.</p>
                  <br>
                  <blockquote>“Sit suscipit tortor turpis sed fringilla lectus facilisis amet. Ipsum, amet dolor curabitur non aliquet orci urna volutpat. Id aliquam neque, ut vivamus sit imperdiet enim, lacus, vel.”</blockquote>
                  <br>
                  <p>
                    <strong>Consectetur Facilisis Vivamus</strong>
                  </p>
                  <br>
                  <ul style="list-style-type:disc;padding-left: 50px;" class="inner-list">
                    <li>Blandit mauris libero condimentum commodo sociis convallis sit.</li>
                    <li>Magna diam amet justo sed vel dolor et volutpat integer.</li>
                    <li>Laculis sit sapien hac odio elementum egestas neque.</li>
                  </ul>
                  <br>
                  <p>Morbi arcu amet, nulla fermentum vitae mattis arcu mi convallis. Urna in sollicitudin in vestibulum erat. Turpis faucibus augue ipsum, at aliquam. Cras sagittis tellus nunc integer vitae neque bibendum eget. Tempus malesuada et pellentesque maecenas. Sociis porttitor elit tincidunt tellus sit ornare. Purus ut ipsum, enim lacus. Praesent imperdiet vitae eu, eu tincidunt nunc integer sit.</p>
                  <br>
                  <p>Tortor diam dignissim amet, in interdum aliquet. Magnis dictum et eros purus fermentum, massa ullamcorper sit sollicitudin. Nascetur libero elementum adipiscing mauris maecenas et magna. Etiam nec, rutrum a diam lacus, nunc integer etiam. Mattis pulvinar non viverra donec pellentesque. Odio mi consequat libero dolor. Porta ut diam lobortis eget leo, lectus. Nunc tempus feugiat massa laoreet ultrices diam magna quam. Congue auctor auctor luctus neque. Enim lorem ultrices diam donec. Sed id placerat consectetur faucibus.</p>
                  <br>
                  <img src="../images/banner-newsletter.jpg" alt="post-image" class="img-fluid">
                  <br>
                  <p>
                    <strong>Velit, praesent pharetra malesuada</strong>
                  </p>
                  <br>
                  <p>Id pulvinar amet. Consequat potenti mollis massa iaculis et, dolor, eget lectus. Aliquam pellentesque molestie felis fames sed eget non euismod eget. Et eget ullamcorper urna, elit ac diam tellus viverra lacus.</p>
                  <br>
                  <p>Tortor diam dignissim amet, in interdum aliquet. Magnis dictum et eros purus fermentum, massa ullamcorper sit sollicitudin. Nascetur libero elementum adipiscing mauris maecenas et magna. Etiam nec, rutrum a diam lacus, nunc integer etiam. Mattis pulvinar non viverra donec pellentesque. Odio mi consequat libero dolor. Porta ut diam lobortis eget leo, lectus.</p>
                  <br>
                  <p>Velit, praesent pharetra malesuada id pulvinar amet. Consequat potenti mollis massa iaculis et, dolor, eget lectus. Aliquam pellentesque molestie felis fames sed eget non euismod eget. Et eget ullamcorper urna, elit ac diam tellus viverra lacus.</p>
                  <br>
                  <p>Tortor diam dignissim amet, in interdum aliquet. Magnis dictum et eros purus fermentum, massa ullamcorper sit sollicitudin. Nascetur libero elementum adipiscing mauris maecenas et magna. Etiam nec, rutrum a diam lacus, nunc integer etiam. Mattis pulvinar non viverra donec pellentesque. Odio mi consequat libero dolor. Porta ut diam lobortis eget leo, lectus.</p>
                  <br>
                  <p>Praesent pharetra malesuada id pulvinar amet. Consequat potenti mollis massa iaculis et, dolor, eget lectus. Aliquam pellentesque molestie felis fames sed eget non euismod eget. Et eget ullamcorper urna, elit ac diam tellus viverra lacus.</p>
                  <br>
                  <p>Tortor diam dignissim amet, in interdum aliquet. Magnis dictum et eros purus fermentum, massa ullamcorper sit sollicitudin. Nascetur libero elementum adipiscing mauris maecenas et magna. Etiam nec, rutrum a diam lacus, nunc integer etiam. Mattis pulvinar non viverra donec pellentesque. Odio mi consequat libero dolor. Porta ut diam lobortis eget leo, lectus.</p>
                  <br>
                  <div class="post-tags mt-5">
                    <div class="block-tag col-md-12">
                        <ul class="list-unstyled d-flex flex-wrap">
                            <li class="pe-3" v-for="(tag, index) in tags" :key="index">
                                <el-button type="warning" size="max" class="text-uppercase btn-rounded" style="background-color: #FBF7EB;color: #6A6965;">{{ tag }}</el-button>
                            </li>
                        </ul>
                    </div>
                  </div>
              </div>
            </div>
            </article>
            <!-- comments -->
            <section id="post-comment">
              <div class="comments-wrap">
                <h2 class="my-5">
                  <span class="count">3</span> Comment
                </h2>
                <div class="comment-list padding-small">
                  <CommentItem v-for="(comment, index) in comments" :key="index" :comment="comment" />
                </div>
              </div>
              <div class="comment-respond mt-3 rounded-5 bg-light p-5 mt-5">
                <h2 class="my-5">Leave a Comment</h2>
                <p>您的电子邮件地址将不会被公布。必填项已标记*</p>
                <br>
                <el-form :model="form">
                  <el-form-item>
                    <el-input type="textarea" v-model="form.comment" placeholder="在这里写下你的评论*"></el-input>
                  </el-form-item>
                  <el-row :gutter="10">
                    <el-col :span="12">
                      <el-form-item>
                        <el-input v-model="form.author"    placeholder="在这里写下你的名字*"></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item>
                        <el-input v-model="form.email"   placeholder="这里写上你的电子邮件地址"></el-input>
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-form-item>
                    <el-button type="primary" class="custom-submit-button" @click="submitForm">Post Comment</el-button>
                  </el-form-item>
                </el-form>
              </div>
            </section>
            <!-- / comments -->
          </div>
        </section>
      </el-main>
      <el-footer>
        <FooterComponent />
      </el-footer>
    </el-container>
  </template>

<script>
  import HeaderComponent from '@/pages/header.vue'
   import FooterComponent from '@/pages/demo.vue'
  
  export default {
    name: 'singlePost',
    components: {
      HeaderComponent,
      FooterComponent
    },
    data() {
      return {
        form: {
          comment: '',
          author: '',
          email: '',
          saveInfo: false
        },
        comments: [
          { author: 'Sam Smith', date: 'Jul 10', content: 'Mattis pulvinar non viverra donec pellentesque. Odio mi consequat libero dolor. Porta ut diam lobortis eget leo, lectus. Tortor diam dignissim amet, in interdum aliquet. Nascetur libero elementum adipiscing mauris maecenas et magna.' },
          { author: 'Santie Mary', date: 'Jul 10', content: 'Tristique tempis condimentum diam done ullancomroer sit element henddg sit he consequert.Tristique tempis condimentum diam done ullancomroer sit element henddg sit he consequert.' },
          { author: 'Analisa Nora', date: 'Jul 10', content: 'Tristique tempis condimentum diam done ullancomroer sit element henddg sit he consequert.Tristique tempis condimentum diam done ullancomroer sit element henddg sit he consequert.' }
        ],
        tags: ['TIPS', 'PLANT HACKS', 'INDOOR']
      }
    },
    methods: {
      submitForm() {
        // 处理表单提交逻辑
        console.log(this.form)
      }
    }
  }
</script>
  
<style scoped>
  /* 基本样式 */
  .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
  }
  
  .my-5 {
    margin-top: 3rem !important;
    margin-bottom: 3rem !important;
  }
  
  .py-5 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
  }
  
  .mb-5 {
    margin-bottom: 3rem !important;
  }
  
  .img-fluid {
    max-width: 100%;
    height: auto;
  }
  
  .post-meta {
    font-size: 0.9em;
    color: #6c757d;
  }
  
  .page-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
  }
  
  .post-description {
    line-height: 1.8;
    color: #212529;
  }
  
  .comment-list {
    list-style: none;
    padding: 0;
  }
  
  .comment-item {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
  }
  
  .comment-item:last-child {
    border-bottom: none;
  }
  
  .comment-meta {
    margin-bottom: 0.5rem;
  }
  
  .author-name {
    font-weight: bold;
  }
  
  .meta-date {
    font-size: 0.8em;
  }
  
  .comment-respond {
    background-color: #f8f9fa;
    padding: 2rem;
    border-radius: 0.5rem;
  }
  
  .comment-respond h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
  }
  
  /* 响应式设计 */
  @media (max-width: 768px) {
    .container {
      padding: 0 1rem;
    }
  
    .page-title {
      font-size: 2rem;
    }
  
    .post-description {
      font-size: 0.9em;
    }
  
    .comment-respond h2 {
      font-size: 1.25rem;
    }
  }
  .post-tags ul {
    list-style: none;
    padding: 0;
    margin: 0;
    white-space:nowrap; /*处理块元素中的空白符和换行  */
  }

  .post-tags li {
    float: left; 
    margin-left: 15px;
    margin-bottom: 0; /* 移除底部间距 */
  }

  .text-uppercase {
    text-transform: uppercase;
  }

  .btn-rounded {
    border-radius: 5px; /* 圆角按钮 */
  }

  .custom-submit-button {
  width: 100%;
  height: 50px;
  border-radius: 10px;
  background-color: #6BB252;
  transition: background-color 0.3s ease;
  }

  .custom-submit-button:hover {
    background-color: #F7A422; /* 悬停时的颜色 */
  } 
</style>